﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;

namespace Sparrow.CMS.HtmlTemplate
{
    using Sparrow.HtmlTemplate;

    [Export(".html",typeof(IViewEngine))]
    [PartCreationPolicy(System.ComponentModel.Composition.CreationPolicy.Shared)]
    public class ViewEngine:IViewEngine
    {
        #region IViewEngine Members

        public IEnumerable<Widget> GetWidgets(Layout layout)
        {
            return Enumerable.Empty<Widget>();
        }

        public string RenderView(string viewName, PageContent content, object model)
        {
            return viewName.AsHtmlTemplate().Bind(model).RenderHtml();
        }

        #endregion
    }
}
